import {baseUrl} from './config.js';
export function topList(){
	
	let ListIds = ['19723756','3779629','2884035','3778678']
	return new Promise(function(reslove,reject){
		uni.request({
			url:`${baseUrl}/toplist/detail`,
			method:'GET',
			data:{},
			success:res=>{
				// console.log(res)
				let result= res.data.list;
				result.length =4;
				for (var i = 0;i<ListIds.length;i++){
					result[i].listid = ListIds[i];
				}
				reslove(result);
			},
			fail:()=>{},
			complete:()=>{}
		});
	})
	
}
export function list(listid){
	return uni.request({
		url:`${baseUrl}/top/list?id=${listid}` ,
		method:'GET',
	})
}
export function songdetail(songid){
	return uni.request({
		url:`${baseUrl}/song/detail?ids=${songid}`,
		method:'GET',
	})
}
export function songsimi(songid){
	return uni.request({
		url:`${baseUrl}/simi/song?id=${songid}`,
		method:'GET',
	})
}
export function songcomment(songid){
	return uni.request({
		url:`${baseUrl}/comment/music?id=${songid}`,
		method:'GET',
	})
}
export function lyric(songid){
	return uni.request({
		url:`${baseUrl}/lyric?id=${songid}`,
		method:'GET',

	})
}
export function songurl(songid){
	return uni.request({
		url:`${baseUrl}/song/url?id=${songid}`,
		method:'GET',
	})
}
export function searchHot(){
	return uni.request({
		url:`${baseUrl}/search/hot/detail`,
		method:'GET',
	})
}
export function searchWord(word){
	return uni.request({
		url:`${baseUrl}/search?keywords=${word}`,
		method:'GET',
	})
}
export function searchSuggest(word){
	return uni.request({
		url:`${baseUrl}/search/suggest?keywords=${word}&type=mobile`,
		method:'GET',
	})
}
export function loding(userId,passWord){
	return uni.request({
		url:`${baseUrl}/login/cellphone?phone=${userId}&password=${passWord}`,
		method:'GET',
	})
}